Telegram Group & Telegram Channel
Что выведет следующий код на Python?


a = 256
b = 256
c = 257
d = 257

print(a is b) # #1
print(c is d) # #2

print(True + True + True == 3) # #3
print(True is 1) # #4
print(False == 0) # #5
print(False is 0) # #6


🔢 Варианты ответа:

A)

True
True
True
True
True


B)

False
True
False
True
False


C)

False
True
False
True
False


D)

True
False
False
False
False


Правильный ответ: B

💡 Почему?
-
a is bTrue, потому что int от -5 до 256 кэшируются.
-
c is dFalse, число 257 не кэшируется.
-
True + True + True == 3True, более того, True == 1.
-
True is 1False — это разные типы (bool и int).
-
False == 0True, False is 0False.



tg-me.com/pro_python_code/1788
Create:
Last Update:

Что выведет следующий код на Python?


a = 256
b = 256
c = 257
d = 257

print(a is b) # #1
print(c is d) # #2

print(True + True + True == 3) # #3
print(True is 1) # #4
print(False == 0) # #5
print(False is 0) # #6


🔢 Варианты ответа:

A)

True
True
True
True
True


B)

False
True
False
True
False


C)

False
True
False
True
False


D)

True
False
False
False
False


Правильный ответ: B

💡 Почему?
-
a is bTrue, потому что int от -5 до 256 кэшируются.
-
c is dFalse, число 257 не кэшируется.
-
True + True + True == 3True, более того, True == 1.
-
True is 1False — это разные типы (bool и int).
-
False == 0True, False is 0False.

BY Python RU


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/pro_python_code/1788

View MORE
Open in Telegram


Python RU Telegram | DID YOU KNOW?

Date: |

Find Channels On Telegram?

Telegram is an aspiring new messaging app that’s taking the world by storm. The app is free, fast, and claims to be one of the safest messengers around. It allows people to connect easily, without any boundaries.You can use channels on Telegram, which are similar to Facebook pages. If you’re wondering how to find channels on Telegram, you’re in the right place. Keep reading and you’ll find out how. Also, you’ll learn more about channels, creating channels yourself, and the difference between private and public Telegram channels.

Python RU from ar


Telegram Python RU
FROM USA